<?xml version='1.0' encoding='UTF-8' ?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition  xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:a4j="http://richfaces.org/a4j"
    xmlns:rich="http://richfaces.org/rich"
    template="/pages/template.xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
	<link rel="StyleSheet" type="text/css" href="/jsf/style/estilos.css" media="screen" />
	<script type="text/javascript" src="/jsf/resources/jquery.maskedinput-1.2.1.js"></script>
</head>

<body>
<ui:define name="content">
<f:view>
	<h:form>
			<fieldset><legend>Atualização de Dados</legend> 
			<h:panelGrid columns="2" id="panelGridInputs">
				<h:outputLabel for="nome" value="Nome "  />
				<h:inputText id="nome" value="#{pessoaMB.pessoa.nome}" style=" width : 254px;"/>
				
				<h:outputLabel for="email" value="E-mail "  />
				<h:inputText id="email" value="#{pessoaMB.pessoa.email}" style=" width : 249px;">
					<f:validator validatorId="emailValidator"/>
				</h:inputText>
				
				<h:outputLabel for="cpf" value="CPF "  />
				<h:inputText id="cpf" validatorMessage="CPF inválido!" value="#{pessoaMB.pessoa.cpf}" size="60" style=" width : 106px;">
					<rich:jQuery selector="#cpf" query="mask('999.999.999-99')" timing="onload"/>
				</h:inputText>
				
				<h:outputLabel for="dataNasc" value="Data Nascimento: "  />
				<h:inputText id="dataNasc" validatorMessage="Data de nascimento com formato inválido!" value="#{pessoaMB.pessoa.dataNascimento}" size="60" style=" width : 75px;">
					<f:convertDateTime pattern="dd/MM/yyyy" />
					<rich:jQuery selector="#dataNasc" query="mask('99/99/9999')" timing="onload"/>
				</h:inputText> 
					
				<h:outputLabel for="telCel" value="Tel. Celular "  />
				<h:inputText id="telCel" value="#{pessoaMB.pessoa.telefoneCelular}">
					<rich:jQuery selector="#telCel" query="mask('(99) 9999-9999')" timing="onload"/>
				</h:inputText>
				
				<a4j:commandButton value="Atualizar" action="#{pessoaMB.merge}" styleClass="botoes" status="sts" reRender="fisicas"/>
				<a4j:commandButton value="Voltar" immediate="true" action="toIndex" styleClass="botoes"/>
			</h:panelGrid>
		</fieldset>
				
	</h:form>
</f:view>
</ui:define>
</body>
</ui:composition>